# Maintainer: Danilo Bürger <danilo@feastr.de>
pkgname=tini
pkgver=0.19.0
pkgrel=0
pkgdesc="A tiny but valid init for containers"
options="!check" # Test suite depends on Docker
url="https://github.com/krallin/tini"
arch="all"
license="MIT"
makedepends="cmake"
subpackages="$pkgname-static"
source="$pkgname-$pkgver.tar.gz::https://github.com/krallin/tini/archive/v$pkgver.tar.gz"

build() {
	export CFLAGS="$CFLAGS -DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None
	make -C build
	make -C build tini-static
}

package() {
	install -Dm755 build/tini "$pkgdir"/sbin/tini
}

static() {
	pkgdesc="Static build of tini"
	install -Dm755 "$builddir"/build/tini-static "$subpkgdir"/sbin/tini-static
}

sha512sums="1fa85b56e2c6085ea474f251928e7a40510d92aeef60b3c145b0496969c1b5df86835d143cb91ef5b4bf4da63fa8a56947cc39a4276e4b72faa57276d432b292  tini-0.19.0.tar.gz"
